<template>
  <div>
    <el-tabs v-model="activeName">
      <el-tab-pane label="歌曲" name="first">
        <div v-if="activeName === 'first'">
          <Song />
        </div>
      </el-tab-pane>
      <el-tab-pane label="专辑" name="second">
        <div v-if="activeName === 'second'">
          <Album />
        </div>
      </el-tab-pane>
      <el-tab-pane label="歌手" name="third">
        <div v-if="activeName === 'third'">
          <Artists />
        </div>
      </el-tab-pane>
      <el-tab-pane label="歌单" name="fourth">
        <div v-if="activeName === 'fourth'">
          <List />
        </div>
      </el-tab-pane>
      <el-tab-pane label="视频" name="five">
        <div v-if="activeName === 'five'">
          <Video_ />
        </div>
      </el-tab-pane>
    </el-tabs>
    <div class="loading" v-if="show === true">
      <i class="el-icon-loading"></i>
    </div>
  </div>
</template>

<script>
export default {
  components: {
    Song: () => import('../components/seachCom/seachSong.vue'),
    Album: () => import('../components/seachCom/SeachAlbum.vue'),
    Artists: () => import('../components/seachCom/SeachArtists.vue'),
    List: () => import('../components/seachCom/SeachList.vue'),
    Video_: () => import('../components/seachCom/SeachVideo.vue')
  },
  data() {
    return {
      activeName: 'first',
      show: false,
    };
  },
  beforeRouteLeave(to, from, next) {
    this.show = true
    next()
  },
};
</script>

<style >
</style>
